/**
 * 公共方法JS
 * Created by dell on 2017/7/14.
 */

/**
 * js 转换日期
 * @param time
 * @returns {*}
 */
function getLocalTime(time){
    if (time==null || time=="")
        return "" ;
    var currentDate = new Date(parseInt(time));
    var currentYear = currentDate.getFullYear();
    var currentMonth = currentDate.getMonth() + 1;
    var currentDay = currentDate.getDate();
    var h = currentDate.getHours();
    var min = currentDate.getMinutes();
    var sec = currentDate.getSeconds();
    if (currentMonth < 10)
    {
        currentMonth = "0".concat(currentMonth);
    }
    if (currentDay < 10)
    {
        currentDay = "0".concat(currentDay);
    }
    if (h < 10)
    {
        h = "0".concat(h);
    }
    if (min < 10)
    {
        min = "0".concat(min);
    }
    if (sec < 10)
    {
        sec = "0".concat(sec);
    }
    //var  date = currentYear + "-" + currentMonth + "-" + currentDay +" " + h + ":" + min + ":" + sec ;
    var  date = currentYear + "-" + currentMonth + "-" + currentDay;
    return date ;
}
